using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Simplify Shared Edges</para>
    /// <para>Simplifies the edges of input features while maintaining the topological relationship with edges shared with other features.</para>
    /// <para>简化输入要素的边，同时保持与与其他要素共享的边的拓扑关系。</para>
    /// </summary>    
    [DisplayName("Simplify Shared Edges")]
    public class SimplifySharedEdges : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SimplifySharedEdges()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The lines or polygons to be simplified.</para>
        /// <para>要简化的线或多边形。</para>
        /// </param>
        /// <param name="_algorithm">
        /// <para>Simplification Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the simplification algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Retain critical points (Douglas-Peucker)—Retains critical points that preserve the essential shape of a polygon outline and removes all other points (Douglas-Peucker). This is the default.</bullet_item><para/>
        ///     <bullet_item>Retain critical bends (Wang-Müller)— Retains the critical bends and removes extraneous bends from a line (Wang-Müller).</bullet_item><para/>
        ///     <bullet_item>Retain weighted effective areas (Zhou-Jones)—Retains vertices that form triangles of effective area that have been weighted by triangle shape (Zhou-Jones).</bullet_item><para/>
        ///     <bullet_item>Retain effective areas (Visvalingam-Whyatt)— Retains vertices that form triangles of effective area (Visvalingam-Whyatt).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定简化算法。</para>
        ///   <bulletList>
        ///     <bullet_item>保留临界点 （Douglas-Peucker） - 保留保留面轮廓基本形状并移除所有其他点 （Douglas-Peucker） 的临界点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>保留关键折弯 （Wang-Müller） - 保留关键折弯并从直线上移除无关折弯 （Wang-Müller）。</bullet_item><para/>
        ///     <bullet_item>保留加权有效面积 （周-Jones） - 保留形成已按三角形形状加权的有效面积三角形的顶点 （周-Jones）。</bullet_item><para/>
        ///     <bullet_item>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_tolerance">
        /// <para>Simplification Tolerance</para>
        /// <para><xdoc>
        ///   <para>Determines the degree of simplification. If a unit is not specified, the units of the input will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.</bullet_item><para/>
        ///     <bullet_item>For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.</bullet_item><para/>
        ///     <bullet_item>For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.</bullet_item><para/>
        ///     <bullet_item>For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定简化程度。如果未指定单位，则将使用输入的单位。</para>
        ///   <bulletList>
        ///     <bullet_item>对于保留临界点 （Douglas-Peucker） 算法，容差是每个顶点与创建的新线之间允许的最大垂直距离。</bullet_item><para/>
        ///     <bullet_item>对于保留临界折弯 （Wang-Müller） 算法，公差是近似于有效折弯的圆的直径。</bullet_item><para/>
        ///     <bullet_item>对于保留加权有效面积 （周-Jones） 算法，公差的平方是由三个相邻顶点定义的有效三角形的面积。三角形偏离等边越远，赋予它的权重就越高，被移除的可能性就越小。</bullet_item><para/>
        ///     <bullet_item>对于保留有效面积 （Visvalingam-Whyatt） 算法，容差的平方是由三个相邻顶点定义的有效三角形的面积。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SimplifySharedEdges(List<object> _in_features, _algorithm_value _algorithm, string? _tolerance)
        {
            this._in_features = _in_features;
            this._algorithm = _algorithm;
            this._tolerance = _tolerance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Simplify Shared Edges";

        public override string CallName => "cartography.SimplifySharedEdges";

        public override List<string> AcceptEnvironments => ["cartographicPartitions"];

        public override object[] ParameterInfo => [_in_features, _algorithm.GetGPValue(), _tolerance, _shared_edge_features, _minimum_area, _in_barriers, _out_feature_class, _out_shared_edge_feature_class];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The lines or polygons to be simplified.</para>
        /// <para>要简化的线或多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_features { get; set; }


        /// <summary>
        /// <para>Simplification Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the simplification algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Retain critical points (Douglas-Peucker)—Retains critical points that preserve the essential shape of a polygon outline and removes all other points (Douglas-Peucker). This is the default.</bullet_item><para/>
        ///     <bullet_item>Retain critical bends (Wang-Müller)— Retains the critical bends and removes extraneous bends from a line (Wang-Müller).</bullet_item><para/>
        ///     <bullet_item>Retain weighted effective areas (Zhou-Jones)—Retains vertices that form triangles of effective area that have been weighted by triangle shape (Zhou-Jones).</bullet_item><para/>
        ///     <bullet_item>Retain effective areas (Visvalingam-Whyatt)— Retains vertices that form triangles of effective area (Visvalingam-Whyatt).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定简化算法。</para>
        ///   <bulletList>
        ///     <bullet_item>保留临界点 （Douglas-Peucker） - 保留保留面轮廓基本形状并移除所有其他点 （Douglas-Peucker） 的临界点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>保留关键折弯 （Wang-Müller） - 保留关键折弯并从直线上移除无关折弯 （Wang-Müller）。</bullet_item><para/>
        ///     <bullet_item>保留加权有效面积 （周-Jones） - 保留形成已按三角形形状加权的有效面积三角形的顶点 （周-Jones）。</bullet_item><para/>
        ///     <bullet_item>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Algorithm")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _algorithm_value _algorithm { get; set; }

        public enum _algorithm_value
        {
            /// <summary>
            /// <para>Retain critical points (Douglas-Peucker)</para>
            /// <para>Retain critical points (Douglas-Peucker)—Retains critical points that preserve the essential shape of a polygon outline and removes all other points (Douglas-Peucker). This is the default.</para>
            /// <para>保留临界点 （Douglas-Peucker） - 保留保留面轮廓基本形状并移除所有其他点 （Douglas-Peucker） 的临界点。这是默认设置。</para>
            /// </summary>
            [Description("Retain critical points (Douglas-Peucker)")]
            [GPEnumValue("POINT_REMOVE")]
            _POINT_REMOVE,

            /// <summary>
            /// <para>Retain critical bends (Wang-Müller)</para>
            /// <para>Retain critical bends (Wang-Müller)— Retains the critical bends and removes extraneous bends from a line (Wang-Müller).</para>
            /// <para>保留关键折弯 （Wang-Müller） - 保留关键折弯并从直线上移除无关折弯 （Wang-Müller）。</para>
            /// </summary>
            [Description("Retain critical bends (Wang-Müller)")]
            [GPEnumValue("BEND_SIMPLIFY")]
            _BEND_SIMPLIFY,

            /// <summary>
            /// <para>Retain weighted effective areas (Zhou-Jones)</para>
            /// <para>Retain weighted effective areas (Zhou-Jones)—Retains vertices that form triangles of effective area that have been weighted by triangle shape (Zhou-Jones).</para>
            /// <para>保留加权有效面积 （周-Jones） - 保留形成已按三角形形状加权的有效面积三角形的顶点 （周-Jones）。</para>
            /// </summary>
            [Description("Retain weighted effective areas (Zhou-Jones)")]
            [GPEnumValue("WEIGHTED_AREA")]
            _WEIGHTED_AREA,

            /// <summary>
            /// <para>Retain effective areas (Visvalingam-Whyatt)</para>
            /// <para>Retain effective areas (Visvalingam-Whyatt)— Retains vertices that form triangles of effective area (Visvalingam-Whyatt).</para>
            /// <para>保留有效面积 （Visvalingam-Whyatt） - 保留形成有效面积三角形的顶点 （Visvalingam-Whyatt）。</para>
            /// </summary>
            [Description("Retain effective areas (Visvalingam-Whyatt)")]
            [GPEnumValue("EFFECTIVE_AREA")]
            _EFFECTIVE_AREA,

        }

        /// <summary>
        /// <para>Simplification Tolerance</para>
        /// <para><xdoc>
        ///   <para>Determines the degree of simplification. If a unit is not specified, the units of the input will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.</bullet_item><para/>
        ///     <bullet_item>For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.</bullet_item><para/>
        ///     <bullet_item>For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.</bullet_item><para/>
        ///     <bullet_item>For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定简化程度。如果未指定单位，则将使用输入的单位。</para>
        ///   <bulletList>
        ///     <bullet_item>对于保留临界点 （Douglas-Peucker） 算法，容差是每个顶点与创建的新线之间允许的最大垂直距离。</bullet_item><para/>
        ///     <bullet_item>对于保留临界折弯 （Wang-Müller） 算法，公差是近似于有效折弯的圆的直径。</bullet_item><para/>
        ///     <bullet_item>对于保留加权有效面积 （周-Jones） 算法，公差的平方是由三个相邻顶点定义的有效三角形的面积。三角形偏离等边越远，赋予它的权重就越高，被移除的可能性就越小。</bullet_item><para/>
        ///     <bullet_item>对于保留有效面积 （Visvalingam-Whyatt） 算法，容差的平方是由三个相邻顶点定义的有效三角形的面积。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _tolerance { get; set; }


        /// <summary>
        /// <para>Shared Edge Features</para>
        /// <para>Line or polygon features that will be simplified along edges shared with input features. Other edges are not simplified.</para>
        /// <para>将沿与输入要素共享的边简化的线或面要素。其他边未简化。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shared Edge Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _shared_edge_features { get; set; } = null;


        /// <summary>
        /// <para>Minimum Area</para>
        /// <para>The minimum area for a polygon to be retained. The default value is zero, which will retain all polygons. A unit can be specified; if no unit is specified, the unit of the input will be used. This parameter is available only when at least one of the inputs is a polygon feature class.</para>
        /// <para>要保留的面的最小面积。默认值为零，将保留所有多边形。可以指定单位;如果未指定单位，则将使用输入的单位。仅当至少有一个输入为面要素类时，此参数才可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _minimum_area { get; set; } = null;


        /// <summary>
        /// <para>Input Barrier Layers</para>
        /// <para>Point, line, or polygon features that act as barriers for the simplification. The simplified features will not touch or cross barrier features.</para>
        /// <para>点、线或面要素，用作简化的障碍。简化的功能不会接触或跨越障碍功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_barriers { get; set; } = null;


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_feature_class { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_shared_edge_feature_class { get; set; }


        public SimplifySharedEdges SetEnv(object cartographicPartitions = null)
        {
            base.SetEnv(cartographicPartitions: cartographicPartitions);
            return this;
        }

    }

}